class login{
    constructor(){
        this.status = 'hide'
    }
    show(){
        if (this.status === 'show'){
            console.log('已经显示')
            return
        }
        this.status = 'show'
        console.log('登陆框显示')
    }
    hide(){
        if (this.status === 'hide'){
            console.log('已经隐藏')
            return
        }
        this.status = 'hide'
        console.log('登陆框隐藏')
    }
}

//控制为单例模式
login.getInstance = (()=>{
    let instance
    return () =>{
        if (!instance){
            instance =  new login()
           }
        return instance
    }
})()

export default {
    login
}